package 命令模式例子;

/**
 * Created by lilei on 2016/3/22.
 *
 *调用者，发出命令
 */

public class Button {
    private Command command_Play;
    private Command command_Stop;

    public Button(Command command_Play, Command command_Stop) {
        this.command_Play = command_Play;
        this.command_Stop = command_Stop;
    }

    public void play() {
        command_Play.excute();
    }
    public void stop() {
        command_Stop.excute();
    }
}
